package com.nightsoul.xmlrpc.test.client;

import java.net.URL;

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class XmlRpcClient {

	public static void main(String[] args) throws Exception {
		XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl();
		// URL为org.apache.xmlrpc.webserver.XmlRpcServlet配置的地址
		clientConfig.setServerURL(new URL("http://127.0.0.1:8800/XML_RPC_Server/servicex"));
		
		org.apache.xmlrpc.client.XmlRpcClient xmlRpcClient = new org.apache.xmlrpc.client.XmlRpcClient();
		xmlRpcClient.setConfig(clientConfig);
		Object result = xmlRpcClient.execute("Calculator.add", new Object[]{10, 20});
		System.out.println(result);
	}
}
